<template>
  <div class="main" >
<!--    <PureEditor :content="this.$route.query.article.content"/>-->
    <el-card style="width: 60%;margin-left: 20%">
      <div slot="header" class="clearfix">
        <el-page-header title="回到之前" @back="back()" :content="this.$route.query.article.title" style="font-weight: bold;font-size: 28px">
        </el-page-header>
<!--        <span style="font-weight: bold;font-size: 28px">{{this.$route.query.article.title}}</span>-->
      </div>
      <div >
        <el-row>
          <el-col :span="2">
        <el-avatar shape="square" :size="50"  :src="userInfo.headpic" ></el-avatar>
          </el-col>
          <el-col :span="15">
        <span style="font-weight: bold;font-size:20px">{{userInfo.name}}<i class="el-icon-medal-1" title="优质作者"></i></span><br>
        <span style="color: #8590A6">{{userInfo.introduce}}</span>
          </el-col >
          <br>
          <el-col :span="6">  <span style="color: #8590A6">发布于:{{this.$route.query.article.createTime}}</span></el-col>
        </el-row>
      </div>
      <p v-html="this.$route.query.article.content"></p>
      <el-backtop target=".page-component__scroll .el-scrollbar__wrap" :bottom="100">
        <div
          style="{
        height: 100%;
        width: 100%;
        background-color: #f2f5f6;
        box-shadow: 0 0 6px rgba(0,0,0, .12);
        text-align: center;
        line-height: 40px;
        color: #1989fa;
      }"
        >
          UP
        </div>
      </el-backtop>
    </el-card>


  </div>
</template>

<script>
  export default {
    name: "ShowArticle",
    components: {
    },
    props:{
      content:{
        type: String,
        default: ""
      }
    },
    data() {
      return {

        userInfo:[]

      };
    },
    created() {
      console.log(this.$route.query.article);
      this.getUser()
    },
    mounted() {
      // this.content=this.$route.query.article.content
    },
    methods: {
      back()
      {
        // this.$router.push('/index')
        this.$router.go(-1)
      },
      getUser()
      {
        this.$http.get("http://localhost:8989/fornote/user/getUserById/"+this.$route.query.article.userId).then(response =>{
          console.log(response.data);
          this.userInfo=response.data
        })
      }
    }
  }
</script>

<style scoped>


</style>
